home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
c
/
cwscr.exe
/
MYMOU.H
< prev
next >
Wrap
Text File
|
1991-05-22
|
2KB
|
74 lines
/*
Mouse module class specification.
This is the header file that should be used when access to a
mouse pointing device is desired.
Library : mycpp.lib
*/
#ifndef __MYMOU_H__
#define __MYMOU_H__
static char MyMouh_Id[] = "mymou.h 1.10 05/22/91";
/*
Version notes :
1.00 - Original creation / release. ( 2-13-91 CW )
1.10 - Added enumeration for button specifier. ( 5-22-91 CW )
*/
/* ================================================================== */
typedef enum { LEFT_BUTTON, RIGHT_BUTTON, MIDDLE_BUTTON } ButtonType;
/* ------------------------------------------------------------------ */
class myMouse {
int xp_pos, yp_pos;
int xr_pos, yr_pos;
int status;
int count;
int button_s; // current button status.
int installed;
int m1, m2, m3, m4; // used for mouse parameters.
void poll_mouse();
public:
myMouse(){
installed = status = 0;
m1 = m2 = m3 = m4 = 0;
poll_mouse();
if( m1 ){
installed = 1;
m1 = 10; // set text cursor.
m2 = 0; // specify software style.
m3 = 0x00FF;
m4 = 0x7100;
poll_mouse();
}
};
~myMouse(){
if( installed && status )
hide();
};
void show();
void hide();
int pressed( ButtonType button );
int released( ButtonType button );
int xpress(){ return( xp_pos ); };
int ypress(){ return( yp_pos ); };
int xrelease(){ return( xr_pos ); };
int yrelease(){ return( yr_pos ); };
void xlimits( int low, int high );
void ylimits( int low, int high );
};
#endif